package com.yijiaganxi.services.api.category;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.yijiaganxi.common.entity.category.YjgxCategory;
import org.yijiaganxi.common.res.R;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.google.common.collect.Lists;
import org.yijiaganxi.common.GlobalConstants;
import com.yijiaganxi.services.service.category.YjgxCategoryService;

@Validated
@RestController
@RequestMapping("/services/yjgxCategory/"+GlobalConstants.WECHAT_FLAG)
public class YjgxCategoryApi {

	@Autowired
	private YjgxCategoryService  categoryService;
	
	/**
	 * 查询首页分类
	 * @return
	 */
	@GetMapping("getAllBannerListApi")
	private R getAllBannerList() {
		return R.opertionListResponse( categoryService.selectList(new EntityWrapper<YjgxCategory>()
				.eq("status", 1)
				.eq("showIndexStatus", 1)
				.orderAsc(Lists.newArrayList("sort"))));
	}
	
}
